<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue.js</title>
    <link rel="stylesheet" href="style.css"/>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<!--vue-app是根容器-->
<div id="vue-app">
    <h1> 双向数据绑定 / input / select / textarea</h1>
    <label>姓名:</label>
    <!-- 1. v-model -->
    <input type="text" @keyup="logName" v-model="name"/>
    <span>{{name}}</span>

    <label>年龄:</label>
    <!-- 2. ref配合js -->
    <input type="text" v-on:keyup="logAge" ref="age"/>
    <span>{{age}}</span>

</div>

<script src="app.js"></script>
</body>
</html>